package com.kjtpay.design_pattern.state;

class EveningState extends State {
    // 晚间时间，（有可能的加班时间），17 ~ 21
    @Override
    public void writeProgram(Work work) {
        if ((work.hour >= 17) && (work.hour < 21)) {
            if (!work.finish) {
                information = "当前时间：" + work.hour + "点" + work.minute + "分"
                        + " ===> 加班哦，疲累之极。";
            } else {
                work.current = new RestState();
                work.writeProgram();
            }
        } else {
            work.current = new SleepingState();
            work.writeProgram();
        }
    }
}
